{extend name="public/base" /}

{block name="title"}<title>{$Think.lang.list}</title>{/block}

{block name="pjax_container"}
<div class="hry-content-wrapper">
<section class="content-header">
    <ol class="breadcrumb">
        <li>会员管理</li>
        <li class="active">会员列表</li>
    </ol>
</section>
<section class="content">
    <div class="row">
        <div class="col-md-12">
            <div class="hry-form-wrapper">
                <div class="box-header with-border" style="height:53px;">
                    <!-- {include file="public/top_action" /} -->
                    {include file="public/member_search" /}
                </div>
                <div class="box-body table-responsive">
                    <table class="table table-bordered table-hover table-sort">
                        <tr>
                            <th>{$Think.lang.id}{:table_sort('id')}</th>
                            <th>{$Think.lang.avatar}</th>
                            <th>姓名</th>
                            <th>{$Think.lang.money}{:table_sort('money')}</th>
                            <th>{$Think.lang.mobile}{:table_sort('mobile')}</th>
                            <th>推荐人</th>
                            <th>推荐人账号</th>
                            <th>邀请码</th>
                            <th>{$Think.lang.create_time}{:table_sort('create_time')}</th>
                            <th>是否实名认证</th>
                            <th>{$Think.lang.is_disable}{:table_sort('is_disable')}</th>
                            <th width="204">{$Think.lang.action}</th>
                        </tr>
                        {volist name="dataList" id="vo"}
                        <tr>
                            <td style="vertical-align:middle">{$vo.id}</td>
                            <td style="vertical-align:middle"><img src='{if condition="$vo.head_thumb"}{$vo.head_thumb}{else}__static__/global/face/default.png{/if}' style="width:50px;border-radius:50%;height: 50px" /></td>
                            <td style="vertical-align:middle"><span data-pk="{$vo.id}" data-name="username" data-url="{:url(CONTROLLER_NAME.'/edit', 'id='.$vo['id'])}" >{$vo.username}</span></td>
                            <td style="vertical-align:middle">{$vo.money}</td>
                            <td style="vertical-align:middle">{$vo.mobile}</td>
                            <td style="vertical-align:middle">{$vo.parent_name|default='无'}</td>
                            <td style="vertical-align:middle">{$vo.parent_mobile}</td>
                            <td style="vertical-align:middle">{$vo.invite}</td>
                            <td style="vertical-align:middle">{$vo.create_time}</td>
                            <td style="vertical-align:middle">
                                {if $vo.is_check eq 1}
                                已实名
                                {else}
                                未实名
                                {/if}
                            </td>
                            <td style="vertical-align:middle">
                                <a href="javascript:void(0);" data-id="{$vo.id}" data-field="is_disable" 
                                data-value="{$vo.is_disable}" data-url="{:url('edit', 'id='.$vo['id'])}" 
                                class='editimg fa {if condition=" $vo.is_disable == 1 "}fa-check-circle text-green{else /}fa-times-circle text-red{/if}'></a>
                            </td>
                            <td style="vertical-align:middle">
								<!-- {:authAction('Money/create', 'recharge', ['user_id' => $vo.id])} -->
                                <a class="btn-text btn-primary btn-xs" href="{:url('Member/edit',['id'=>$vo.id])}">查看</a>
                                <a class="btn-text btn-success btn-xs" href="{:url('Member/account',['id'=>$vo.id])}">明细</a>
                                <a class="btn-text btn-success btn-xs order_detail" href="/hryweb.php/member/memberOrderDetailList/uid/{$vo.id}">订单详情</a>
                            </td>
                        </tr>
                        {/volist}
                    </table>
                </div>
                <div class="box-footer clearfix">
                    {$dataList->render()}
                </div>
            </div>
        </div>
    </div>
</section>
</div>
<script type="text/javascript">
$(function(){
    /*ajax页面加载icheck，有该控件的页面才需要*/
    $('input[type="checkbox"].minimal, input[type="radio"].minimal').iCheck({
        checkboxClass: 'icheckbox_minimal-blue',
        radioClass: 'iradio_minimal-blue'
    });
	
    /*ajax页面加载icheck，有该控件的页面才需要*/
    $(".select2").select2({language:"zh-CN"});
    
    /*全选-反选*/
    $('.checkbox-toggle').on('ifChecked', function(event){
        var _this = $(this);
        var _table = _this.closest('.table');
        _table.find("tr td input[type='checkbox']").iCheck("check");
    });
    $('.checkbox-toggle').on('ifUnchecked', function(event){
        var _this = $(this);
        var _table = _this.closest('.table');
        _table.find("tr td input[type='checkbox']").iCheck("uncheck");
    });
    
    $('.editable').editable({
        emptytext: "empty",
        params: function(params) {      //参数
            var data = {};
            data['id'] = params.pk;
            data[params.name] = params.value;
            return data;
        },
        success: function(response, newValue) {
            var res = $.parseJSON( response );
            if(res.status == 1){
            }else{
                return res.info;
            }
        }
    });
    
    {if condition=" $rest_login == 1 "}
    restlogin('{$rest_login_info}');   //登录超时
    {/if}
})
</script>

<style type="text/css">

</style>

{/block}